<?php

namespace app\api\model\scenic;

use think\Model;


class ScenicMedia extends Model
{





    // 表名
    protected $name = 'scenic_media';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'type_text'
    ];

    public function getTypelList()
    {
        return [0=>'景区会所',1=>'打卡景点',2=>'配套设施',3=>'航拍',4=>'导航图',5=>'视频'];
    }

    public function getTypeTextAttr($value, $data)
    {
        $value = $value ?: ($data['type'] ?? '');
        $list = $this->getTypelList();
        return $list[$value] ?? '';
    }




}
